<?php
namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests;
use App\Model\Product;
use JWTAuth;
use DB;

class ProductApiController extends Controller
{

    public function __construct()
    {
        parent::__construct();
        view()->share([
            '_xApi' => 'am-in',
        ]);
    }
    
    function getOrderList()
    {
        $data = array();
        $order = Product::select('name','price','thumb')->get()->toArray();

        if (empty($order)) {
            $data['info'] = '获取数据失败';
            $data['status'] = false;
            return $data;
        }
        
        $data['status'] = true;
        $data['info'] = '成功获取信息';
        $data['data']=$order;
        return $data;
    }
}
